package mylibrary.spider.framework;

import mylibrary.spider.framework.task.CrawlTask;

public class Starter {

	//private static String startUrl = "http://www.163.com/";
	private static String startUrl = "http://localhost/sample";
	
	
	public static void main(String[] args) throws Exception {
		
		Page startPage = new Page(startUrl, null);
		
		Crawler crawler = new Crawler();
		crawler.crawl(startPage);
		
		//fire 10 threads to crawl sub page
		for(int i=0; i<10; i++) {
			Thread thread = new Thread(new CrawlTask(Crawler.detectedUrl));
			thread.setName("Thread-" + i);
			thread.start();
		}
	}
}
